
package Migue;

import java.io.*;

public class Rimas {
 public static void main(String[] args) throws FileNotFoundException, IOException {
        File archivo = new File("C:\\archivo.txt");
        FileReader fr = new FileReader(archivo);
        BufferedReader br = new BufferedReader(fr);
        String linea1 = br.readLine();
        String linea2 = br.readLine();
        String linea3 = br.readLine();
        String linea4 = br.readLine();
        System.out.println("" + linea1);
        System.out.println("" + linea2);
        System.out.println("" + linea3);
        System.out.println("" + linea4 + "\n");
        if (linea1.endsWith(linea3.substring(linea3.length() - 3, linea3.length())) && linea2.endsWith(linea4.substring(linea4.length() - 3, linea4.length()))) {
        System.out.println("Riman");
        } else {
            System.out.println("No riman");
        }
    }
}
